package com.jfinal.cli.common.generator;

import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;

import com.jfinal.plugin.activerecord.generator.MetaBuilder;

/**
 * @author: lbq
 * @email: 526509994@qq.com
 * @date: 2019/4/17
 */
public class AppMetaBuilder extends MetaBuilder {
    private List<String> generatorTableList = new ArrayList();

    public AppMetaBuilder(DataSource dataSource) {
        super(dataSource);
    }

    @Override
    protected boolean isSkipTable(String tableName) {
        if (this.generatorTableList.contains(tableName)) {
            return false;
        } else {
            return true;
        }
    }

    /**
     * 添加要生成的表
     *
     * @param tableName
     */
    public void addTable(String tableName) {
        this.generatorTableList.add(tableName);
    }
}
